﻿@{
    ViewBag.Title = "测评设置";
}

@model WebApp.ViewModels.Evaluate.EvalSettingModel

<div id="breadcrumb">
    <a href="#"><i class="fa fa-bookmark"></i> 测评管理</a>
    <a href="#" class="current">当年测评设置</a>
</div>

@using (Html.BeginForm("", "", FormMethod.Post, new { @class = "form-horizontal form-inline", id = "inputform" }))
{
    <input type="hidden" id="Id" value="@Model.Eval.Id" />

    <div class="row">
        <div class="col-xs-12">
            <button id="btnsave" class="btn btn-primary">保存设置</button>
        </div>
    </div>

    <div class="row">
        <div class="col-xs-12">
            <table class="table table-bordered" style="background:#fafafa">
                <tbody>
                    <tr>
                        <td colspan="4" style="text-align:left;background: #f1f1f1;padding: 15px 10px; position:relative;">
                            年度测评设置
                            <span style="color:#ff6a00;">（注意：只有测评状态为“进行中”，且在指定的时间范围内，才能登陆进行测评。）</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-label">当前测评年度</td>
                        <td class="td-content"><span>@Model.Eval.EvaluateYear</span></td>
                        <td class="td-label">测评状态</td>
                        <td class="td-content">
                            @Html.DropDownList("Status", Model.Eval.Status.ToString(), ViewBag.StatusSelectList as SelectList, new { @class = "form-control datafield", data_fieldname= "Status" })
                        </td>
                    </tr>
                    <tr>
                        <td class="td-label">开始日期</td>
                        <td class="td-content">
                            @Html.DatePicker("EvaluateStart", Model.Eval.EvaluateStart, "yyyy-MM-dd", new { @class = "form-control datafield", data_fieldname = "EvaluateStart" })
                        </td>
                        <td class="td-label">结束日期</td>
                        <td class="td-content">
                            @Html.DatePicker("EvaluateEnd", Model.Eval.EvaluateEnd, "yyyy-MM-dd", new { @class = "form-control datafield", data_fieldname = "EvaluateEnd" })
                        </td>
                    </tr>
                </tbody>
            </table>
            <table class="table table-bordered grid-edit" style="background:#fafafa;" id="list-table">
                <thead>
                    <tr>
                        <th style="width:5%;text-align:center;">序号</th>
                        <th style="width:20%;text-align:center;">车间名称</th>
                        <th style="width:10%;text-align:center;">计划测评人数</th>
                        <th style="width:15%;text-align:center;">测评密码(<a href="#none" id="randomPwd">生成随机密码</a>)</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody class="list-data">
                    @{
                        int iloop = 0;
                    }
                    @foreach (var item in Model.EvalDeptList)
                    {
                        <tr data-id="@item.Id">
                            <td class="td-list-content" style="text-align:center;">
                                @(iloop + 1)
                            </td>
                            <td class="td-list-content" style="text-align:center;">@item.Eval_deptname</td>
                            <td class="td-list-content" style="text-align:center;">
                                @Html.TextBox("Requireusers" + iloop.ToString(), item.Requireusers, new { @class = "form-control list-datafield", data_fieldname = "Requireusers" })
                            </td>
                            <td class="td-list-content" style="text-align:center;">
                                @Html.TextBox("Password" + iloop.ToString(), item.Password, new { @class = "form-control list-datafield", data_fieldname = "Password" })
                            </td>
                            <td class="td-list-content" style="text-align:center;"></td>
                        </tr>
                        iloop++;
                    }
                </tbody>
            </table>
        </div>
    </div>
                        }

@section css{
    <style type="text/css">
        .table > tbody > tr > td {
            padding: 5px;
        }
            .table > tbody > tr > td.td-label, 
            .table > tbody > tr > td.td-content,
            .table > tbody > tr > td.td-list-content {
                line-height: 25px;
            }

        .td-head {
            text-align: center;
            font-weight: bold;
        }

        .td-label {
            text-align: center;
            width: 14%;
            color: #666;
        }

        .td-content {
            text-align: left;
            width: 36%;
            color: #085fa6;
        }

        .td-list-content {
            color: #085fa6;
        }

        .td-remark-time {
            text-align: left;
            color: #666;
            padding: 3px 5px;
        }

        .td-remark {
            text-align: left;
            color: #085fa6;
            padding: 3px 5px;
        }
    </style>
}

@section scripts{
    <script type="text/javascript">
        var canEdit = @(ViewBag.CanEdit ? "true" : "false");
    </script>

    <script type="text/javascript" src="~/Scripts/app/eval/eval.setting.js?ver=@WebApp.BLL.CommonStr.Ver"></script>
}
